# -*- encoding: utf-8 -*-
JUMP_IP = '101.201.57.102'  # 跳板机

config = None


def init_conf(env='pc'):
    from setting import PCConfig, APIConfig
    global config
    if env == 'pc':
        config = PCConfig()
    elif env == 'api':
        config = APIConfig()
    elif env == 'apitest':
        config = APITestConfig()
    elif env == 'banktest':
        config = BankTestConfig()
    return config


class APIConfig(object):
    JUMP_IP = '101.201.57.102'  # 跳板机
    PORT = 22
    JUMP_TMP_FOLDER = '/tmp'  # 上传文件存储位置
    JUMP_PYTHON_FILE_PATH = '/tmp/api'

    SERVER_IPS = ['192.168.1.10', '192.168.1.11']
    SERVER_TMP_FOLDER = '/tmp'  # 上传文件存储位置
    SERVER_TOMCAT_PATH = '/usr/local/tomcat'
    SERVER_TOMCAT_DELETE_PATHS = ['/webapps/ROOT/public', '/webapps/ROOT/views', '/webapps/ROOT/WEB_INF/classes',
                                  '/webapps/ROOT/WEB_INF/jsp', '/webapps/ROOT/WEB_INF/web.xml']  # 需要删除的文件
    SERVER_BAK_PATH = '%s/webapps' % SERVER_TOMCAT_PATH  # 需要备份文件目录
    SERVER_BAK_FOLDER = 'ROOT'  # 需要备份的文件夹

    LOCAL_PACKAGE_PATH = '/Users/wlsnow/Projects/cxd_git/ghbmobileApi'  # 本地项目路径
    # LOCAL_PACKAGE_FOLDER = 'mobileApi'  # 需要打包的文件夹
    LOCAL_PACKAGE_FOLDER = 'classes'
    LOCAL_PACKAGE_EXCLUDER = ['/target/mobileApi/swagger-ui', '/target/mobileApi/WEB-INF/lib',
                              '/target/mobileApi/META-INF']  # 打tar.gz需要排除的文件夹
    LOCAL_PACKAGE_SUFFIX = '.tar.gz'
    LOCAL_KEY_FILE_PATH = '/Users/wlsnow/Desktop/cxdprod'
    PASSWORD = None


class APITestConfig(object):
    JUMP_IP = '192.168.200.206'  # 跳板机
    PORT = 22
    JUMP_TMP_FOLDER = '/tmp'  # 上传文件存储位置
    JUMP_PYTHON_FILE_PATH = '%s/api' % JUMP_TMP_FOLDER

    SERVER_IPS = ['192.168.200.206']
    SERVER_TMP_FOLDER = '/tmp'  # 上传文件存储位置
    SERVER_TOMCAT_PATH = '/usr/local/tomcat'
    SERVER_TOMCAT_DELETE_PATHS = ['/webapps/ROOT/public', '/webapps/ROOT/views', '/webapps/ROOT/WEB_INF/classes',
                                  '/webapps/ROOT/WEB_INF/jsp', '/webapps/ROOT/WEB_INF/web.xml']  # 需要删除的文件
    SERVER_BAK_PATH = '%s/webapps' % SERVER_TOMCAT_PATH  # 需要备份文件目录
    SERVER_BAK_FOLDER = 'ROOT'  # 需要备份的文件夹

    LOCAL_PACKAGE_PATH = '/Users/wlsnow/Projects/cxd_git/ghbmobileApi'  # 本地项目路径
    LOCAL_PACKAGE_FOLDER = 'classes'
    LOCAL_PACKAGE_EXCLUDER = ['/target/mobileApi/swagger-ui', '/target/mobileApi/WEB-INF/lib',
                              '/target/mobileApi/META-INF']  # 打tar.gz需要排除的文件夹
    LOCAL_PACKAGE_SUFFIX = '.tar.gz'
    LOCAL_KEY_FILE_PATH = '/Users/wlsnow/Desktop/cxdprod'
    PASSWORD = '1'


class PCConfig(object):
    JUMP_IP = '101.201.57.102'  # 跳板机
    PORT = 22
    JUMP_TMP_FOLDER = '/tmp'  # 上传文件存储位置
    JUMP_PYTHON_FILE_PATH = '%s/api' % JUMP_TMP_FOLDER

    SERVER_IPS = ['192.168.1.10', '192.168.1.11']
    SERVER_TMP_FOLDER = '/tmp'  # 上传文件存储位置
    SERVER_BAK_PATH = '/usr/local/tomcat/webapps'  # 需要本分文件目录
    SERVER_BAK_FOLDER = 'ROOT'  # 需要备份的文件夹

    LOCAL_PACKAGE_PATH = '/Users/wlsnow/Projects/cxd_git/ghbmobileApi'  # 本地项目路径
    LOCAL_PACKAGE_FOLDER = 'mobileApi'  # 需要打包的文件夹
    LOCAL_PACKAGE_EXCLUDER = ['/target/mobileApi/swagger-ui', '/target/mobileApi/WEB-INF/lib',
                              '/target/mobileApi/META-INF']  # 打tar.gz需要排除的文件夹
    LOCAL_PACKAGE_SUFFIX = '.tar.gz'


class BankTestConfig(object):
    JUMP_IP = '101.201.145.110 '  # 跳板机
    PORT = 52113
    JUMP_TMP_FOLDER = '/tmp'  # 上传文件存储位置
    JUMP_PYTHON_FILE_PATH = '%s/banktest' % JUMP_TMP_FOLDER

    SERVER_IPS = ['101.201.145.110']
    SERVER_TMP_FOLDER = '/tmp'  # 上传文件存储位置
    SERVER_BAK_PATH = '/usr/local/service'  # 需要本分文件目录
    SERVER_BAK_FOLDER = 'cxd-bank-service-1.0-SNAPSHOT.jar'  # 需要备份的文件夹

    LOCAL_PACKAGE_PATH = '/Users/wlsnow/Projects/cxd-bank-service'  # 本地项目路径
    LOCAL_PACKAGE_FOLDER = 'mobileApi'  # 需要打包的文件夹
    LOCAL_PACKAGE_EXCLUDER = ['/target/mobileApi/swagger-ui', '/target/mobileApi/WEB-INF/lib',
                              '/target/mobileApi/META-INF']  # 打tar.gz需要排除的文件夹
    LOCAL_PACKAGE_SUFFIX = '.tar.gz'
    PASSWORD = 'mrRET1127XtP'
